<template>
  <div class="response-cookies">
    <el-table :data="cookies" style="width: 100%" empty-text="无 Cookies">
      <el-table-column prop="name" label="名称" width="150" />
      <el-table-column prop="value" label="值" show-overflow-tooltip />
      <el-table-column prop="domain" label="域" width="150" />
      <el-table-column prop="path" label="路径" width="100" />
      <el-table-column prop="expires" label="过期时间" width="180">
        <template slot-scope="scope">
          {{ scope.row.expires || 'Session' }}
        </template>
      </el-table-column>
      <el-table-column prop="httpOnly" label="HttpOnly" width="80">
        <template slot-scope="scope">
          <el-tag v-if="scope.row.httpOnly" size="mini" type="info">是</el-tag>
          <el-tag v-else size="mini">否</el-tag>
        </template>
      </el-table-column>
      <el-table-column prop="secure" label="Secure" width="80">
        <template slot-scope="scope">
          <el-tag v-if="scope.row.secure" size="mini" type="success">是</el-tag>
          <el-tag v-else size="mini">否</el-tag>
        </template>
      </el-table-column>
    </el-table>
  </div>
</template>

<script>
export default {
  name: 'ResponseCookies',
  props: {
    cookies: {
      type: Array,
      default: () => []
    }
  }
}
</script>

<style lang="scss" scoped>
.response-cookies {
  // Styles inherited from global
}
</style>